﻿using System.Windows;

namespace AnjLab.SyncIT.App
{
    /// <summary>
    /// Interaction logic for EditContenttTemplateWindow.xaml
    /// </summary>
    public partial class EditContentTemplateWindow : Window
    {
        public EditContentTemplateWindow()
        {
            InitializeComponent();
        }

        public string TemplateText
        {
            get{ return templateTextBox.Text; }
            set { templateTextBox.Text = value; }
        }

        public bool MultiLine
        {
            get { return templateTextBox.AcceptsReturn; }
            set
            {
                templateTextBox.AcceptsReturn = value;
                if (!value)
                    templateTextBox.Text = templateTextBox.Text.Replace("\n", "");
            }
        }

        private void OnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
            Close();
        }
    }
}
